<?php
session_start();
if(empty($_SESSION['adminUser']))
{
	echo "no auth";
	exit;
}
$file = $_GET['f'];
if(file_exists($file))
{
	$baseFileName = basename($file);
	$webPath = str_replace(basename(__FILE__),"",__FILE__);
	$webPath = str_replace("actions/","",$webPath);
	$src = $webPath.$file;
	$tempPdf = $webPath."res/temp/".substr($baseFileName,0,strrpos($baseFileName,".")).".pdf";
	//echo $src."<br/>";
 
	if(!file_exists($tempPdf))
	{
		system("python /data/program/office/DocumentConverter.py $src $tempPdf &");
	}
}

//echo str_replace(basename(__FILE__),"",__FILE__);

//system("python /data/program/office/DocumentConverter.py /data/web/jeep/resman/res/20150529/file_556818cb0e526.docx /data/web/jeep/resman/res/temp/111.pdf &");
?>